package cn.gson.springmvc.model.pojos;

import javax.persistence.*;
import java.sql.Date;
import java.util.Collection;
import java.util.Objects;

@Entity
public class Hospinfo {
    private int hospinfoId;
    private String hospinfoName;
    private String hospinfoGender;
    private Integer hospinfoAge;
    private Integer hospinfoPhone;
    private String hospinfoAdderr;
    private Integer hospinfoDevice;
    private String hospinfoObta;
    private String hospinfoInsert;
    private Integer hospinfoDeptotal;
    private Integer hospinfoDepbalance;
    private String hospinfoAttending;
    private String hospinfoNurses;
    private Date hospinfoDate;
    private Integer hospinfoState;
    private String hospinfoPersonnel;
    private String hosptionDepart;
    private Collection<Dailycost> dailycostsByHospinfoId;
    private Collection<Electpres> electpresByHospinfoId;
    private Southrecord southrecordBySouthrecordId;
    private Collection<Operarrange> operarrangesByHospinfoId;

    @Id
    @Column(name = "hospinfo_id", nullable = false)
    public int getHospinfoId() {
        return hospinfoId;
    }

    public void setHospinfoId(int hospinfoId) {
        this.hospinfoId = hospinfoId;
    }

    @Basic
    @Column(name = "hospinfo_name", nullable = true, length = 50)
    public String getHospinfoName() {
        return hospinfoName;
    }

    public void setHospinfoName(String hospinfoName) {
        this.hospinfoName = hospinfoName;
    }

    @Basic
    @Column(name = "hospinfo_gender", nullable = true, length = 50)
    public String getHospinfoGender() {
        return hospinfoGender;
    }

    public void setHospinfoGender(String hospinfoGender) {
        this.hospinfoGender = hospinfoGender;
    }

    @Basic
    @Column(name = "hospinfo_age", nullable = true)
    public Integer getHospinfoAge() {
        return hospinfoAge;
    }

    public void setHospinfoAge(Integer hospinfoAge) {
        this.hospinfoAge = hospinfoAge;
    }

    @Basic
    @Column(name = "hospinfo_phone", nullable = true)
    public Integer getHospinfoPhone() {
        return hospinfoPhone;
    }

    public void setHospinfoPhone(Integer hospinfoPhone) {
        this.hospinfoPhone = hospinfoPhone;
    }

    @Basic
    @Column(name = "hospinfo_adderr", nullable = true, length = 100)
    public String getHospinfoAdderr() {
        return hospinfoAdderr;
    }

    public void setHospinfoAdderr(String hospinfoAdderr) {
        this.hospinfoAdderr = hospinfoAdderr;
    }

    @Basic
    @Column(name = "hospinfo_device", nullable = true)
    public Integer getHospinfoDevice() {
        return hospinfoDevice;
    }

    public void setHospinfoDevice(Integer hospinfoDevice) {
        this.hospinfoDevice = hospinfoDevice;
    }

    @Basic
    @Column(name = "hospinfo_obta", nullable = true, length = 30)
    public String getHospinfoObta() {
        return hospinfoObta;
    }

    public void setHospinfoObta(String hospinfoObta) {
        this.hospinfoObta = hospinfoObta;
    }

    @Basic
    @Column(name = "hospinfo_insert", nullable = true, length = 30)
    public String getHospinfoInsert() {
        return hospinfoInsert;
    }

    public void setHospinfoInsert(String hospinfoInsert) {
        this.hospinfoInsert = hospinfoInsert;
    }

    @Basic
    @Column(name = "hospinfo_deptotal", nullable = true, precision = 0)
    public Integer getHospinfoDeptotal() {
        return hospinfoDeptotal;
    }

    public void setHospinfoDeptotal(Integer hospinfoDeptotal) {
        this.hospinfoDeptotal = hospinfoDeptotal;
    }

    @Basic
    @Column(name = "hospinfo_depbalance", nullable = true, precision = 0)
    public Integer getHospinfoDepbalance() {
        return hospinfoDepbalance;
    }

    public void setHospinfoDepbalance(Integer hospinfoDepbalance) {
        this.hospinfoDepbalance = hospinfoDepbalance;
    }

    @Basic
    @Column(name = "hospinfo_attending", nullable = true, length = 30)
    public String getHospinfoAttending() {
        return hospinfoAttending;
    }

    public void setHospinfoAttending(String hospinfoAttending) {
        this.hospinfoAttending = hospinfoAttending;
    }

    @Basic
    @Column(name = "hospinfo_nurses", nullable = true, length = 30)
    public String getHospinfoNurses() {
        return hospinfoNurses;
    }

    public void setHospinfoNurses(String hospinfoNurses) {
        this.hospinfoNurses = hospinfoNurses;
    }

    @Basic
    @Column(name = "hospinfo_date", nullable = true)
    public Date getHospinfoDate() {
        return hospinfoDate;
    }

    public void setHospinfoDate(Date hospinfoDate) {
        this.hospinfoDate = hospinfoDate;
    }

    @Basic
    @Column(name = "hospinfo_state", nullable = true)
    public Integer getHospinfoState() {
        return hospinfoState;
    }

    public void setHospinfoState(Integer hospinfoState) {
        this.hospinfoState = hospinfoState;
    }

    @Basic
    @Column(name = "hospinfo_personnel", nullable = true, length = 30)
    public String getHospinfoPersonnel() {
        return hospinfoPersonnel;
    }

    public void setHospinfoPersonnel(String hospinfoPersonnel) {
        this.hospinfoPersonnel = hospinfoPersonnel;
    }

    @Basic
    @Column(name = "hosption_depart", nullable = true, length = 50)
    public String getHosptionDepart() {
        return hosptionDepart;
    }

    public void setHosptionDepart(String hosptionDepart) {
        this.hosptionDepart = hosptionDepart;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Hospinfo hospinfo = (Hospinfo) o;
        return hospinfoId == hospinfo.hospinfoId &&
                Objects.equals(hospinfoName, hospinfo.hospinfoName) &&
                Objects.equals(hospinfoGender, hospinfo.hospinfoGender) &&
                Objects.equals(hospinfoAge, hospinfo.hospinfoAge) &&
                Objects.equals(hospinfoPhone, hospinfo.hospinfoPhone) &&
                Objects.equals(hospinfoAdderr, hospinfo.hospinfoAdderr) &&
                Objects.equals(hospinfoDevice, hospinfo.hospinfoDevice) &&
                Objects.equals(hospinfoObta, hospinfo.hospinfoObta) &&
                Objects.equals(hospinfoInsert, hospinfo.hospinfoInsert) &&
                Objects.equals(hospinfoDeptotal, hospinfo.hospinfoDeptotal) &&
                Objects.equals(hospinfoDepbalance, hospinfo.hospinfoDepbalance) &&
                Objects.equals(hospinfoAttending, hospinfo.hospinfoAttending) &&
                Objects.equals(hospinfoNurses, hospinfo.hospinfoNurses) &&
                Objects.equals(hospinfoDate, hospinfo.hospinfoDate) &&
                Objects.equals(hospinfoState, hospinfo.hospinfoState) &&
                Objects.equals(hospinfoPersonnel, hospinfo.hospinfoPersonnel) &&
                Objects.equals(hosptionDepart, hospinfo.hosptionDepart);
    }

    @Override
    public int hashCode() {
        return Objects.hash(hospinfoId, hospinfoName, hospinfoGender, hospinfoAge, hospinfoPhone, hospinfoAdderr, hospinfoDevice, hospinfoObta, hospinfoInsert, hospinfoDeptotal, hospinfoDepbalance, hospinfoAttending, hospinfoNurses, hospinfoDate, hospinfoState, hospinfoPersonnel, hosptionDepart);
    }

    @OneToMany(mappedBy = "hospinfoByHospinfoId")
    public Collection<Dailycost> getDailycostsByHospinfoId() {
        return dailycostsByHospinfoId;
    }

    public void setDailycostsByHospinfoId(Collection<Dailycost> dailycostsByHospinfoId) {
        this.dailycostsByHospinfoId = dailycostsByHospinfoId;
    }

    @OneToMany(mappedBy = "hospinfoByHospinfoId")
    public Collection<Electpres> getElectpresByHospinfoId() {
        return electpresByHospinfoId;
    }

    public void setElectpresByHospinfoId(Collection<Electpres> electpresByHospinfoId) {
        this.electpresByHospinfoId = electpresByHospinfoId;
    }

    @ManyToOne
    @JoinColumn(name = "southrecord_id", referencedColumnName = "southrecord_id")
    public Southrecord getSouthrecordBySouthrecordId() {
        return southrecordBySouthrecordId;
    }

    public void setSouthrecordBySouthrecordId(Southrecord southrecordBySouthrecordId) {
        this.southrecordBySouthrecordId = southrecordBySouthrecordId;
    }

    @OneToMany(mappedBy = "hospinfoByHospinfoId")
    public Collection<Operarrange> getOperarrangesByHospinfoId() {
        return operarrangesByHospinfoId;
    }

    public void setOperarrangesByHospinfoId(Collection<Operarrange> operarrangesByHospinfoId) {
        this.operarrangesByHospinfoId = operarrangesByHospinfoId;
    }
}
